package com.xh.xyzp.domain.vo;

import com.xh.xyzp.exception.ApiException;
import com.xh.xyzp.util.AssertUtil;
import lombok.Data;

/**
 * @Author: xainghao
 * @Description:
 * @Date: 2025-04-12  11:10
 */
@Data
public class RegisterReq {
    private String username;
    private String password;
    private String password2;
    private Integer type;
    private String companyName;
    private String companyAddress;
    private String companyAvatar;
    private String code;
    private String email;

    public void checkParams() {
        AssertUtil.isNotEmpty(username, "账号不能为空");
        AssertUtil.isNotEmpty(password, "密码不能为空");
        AssertUtil.isNotEmpty(password2, "确认密码不能为空");
//        AssertUtil.isNotEmpty(email, "邮件不能为空");
//        AssertUtil.isNotEmpty(code, "验证码不能为空");
        if (!password.equals(password2)) {
            throw new ApiException("两次密码不一致");
        }
    }
}
